<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href='<?php echo asset_url()."customcss/custombody.css"; ?>'>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script type="text/javascript" src='<?php echo asset_url()."js/validate.min.js"; ?>'></script>
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
  
  <script type="text/javascript">
	  function validateForm() {
		  var title = document.forms["postjob"]["title"].value;
		  if (title==null || title=="")
		    {
			alert('Enter Title');
		    return false;
		    }
		   var vacancy = document.forms["postjob"]["vacancy"].value;
		   if (vacancy==null || vacancy=="")
		    {
			alert('Enter number of vacant positions');
		    return false;
		    }
		   var cdate = document.forms["postjob"]["cdate"].value;
		   if (cdate==null || cdate=="")
		    {
			alert('Enter the last date');
		    return false;
		    }
		   var elig = document.forms["postjob"]["elig"].value;
		   if (elig==null || elig=="")
		    {
			alert('Enter eligibility');
		    return false;
		    }
		   var profile = document.forms["postjob"]["profile"].value;
		   if (profile==null || profile=="")
		    {
			alert('Enter profile');
		    return false;
		    }
		   var desc = document.forms["postjob"]["desc"].value;
		   if (desc==null || desc=="")
		    {
			alert('Enter description');
		    return false;
		    }
		}

  </script>

<title>AITAA&reg - Add Job Information</title>

</head>
<body>

<div id="container">
<h3><span class="label label-primary">Edit Job Information </span></h3>
<br><br>
<?php 
	foreach ($query as $row)
	{
?>
<form action='<?php echo base_url();?>index.php/admin/career/editprocess/<?php echo $row->jobId;?>' method='post' name='postjob' onsubmit="return validateForm()">
<table class="table table-hover">
<input type="hidden" value="<?php echo $row->id; ?>"  class="form-control" name="UID">
<tr><th>Title</th><td><input type="text" value="<?php echo $row->title; ?>"  class="form-control" name="title"></td></tr>
<tr><th>No of Vacancies</th><td><input type="text" value="<?php echo $row->vacancy; ?>"  class="form-control" name="vacancy"></td></tr>
<tr><th>Last Date to Apply</th><td><input type="text" id="datepicker" name="cdate" value="<?php echo $this->common->dateformatnormal($row->cdate)?>" readonly></td></tr>
<tr><th>Eligibility</th><td><textarea class="form-control" rows="4" cols="50" name="elig"><?php echo $row->elig; ?></textarea></td></tr>
<tr><th>Job Profile</th><td><textarea class="form-control" rows="4" cols="50" name="profile" value=""><?php echo $row->profile; ?></textarea></td></tr>
<tr><th>Description</th><td><textarea class="form-control" rows="4" cols="50" name="desc" value=""><?php echo $row->desc; ?></textarea></td></tr>
<tr><th>Posted By</th><td><input type="text" value="<?php echo $row->name; ?>"  class="form-control" name="name" <?php echo $row->name; ?> readonly></td></tr>
<tr><td><b>Contact Email ID</b> (change this in case a different person)</td><td><input type="text" class="form-control" value="<?php echo $row->contact; ?>" name="mail"></td></tr>
<tr><th>Admin Approval</th><td><input type="checkbox" name="admin" value = '1' <?php echo ($row->admin==1 ? 'checked' : '');?> /></td></tr>

<tr><td colspan=2 align="center"><button type="submit" class="btn btn-primary">Submit</button> &nbsp; &nbsp;<a href="<?php echo $_SERVER['HTTP_REFERER']?>"><button class="btn btn-warning">Go Back</button></a></td></tr>

</table>
</form>
<?php 
	}
?>
</form>

</div>
	<script src='<?php echo asset_url()."/js/bootstrap.min.js"?>'></script>
	<script src='<?php echo asset_url()."/js/jquery-1.10.2.min.js"?>'></script>
	</body>
</html>